package com.offcn.user.dao;


import com.offcn.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserDao {
    //用户列表查询
    @Select("select * from user")
    List<User> selectUserList();

    //添加数据
    @Insert("insert into user(username,password) value(#{username},#{password})")
    void insertUser(User user);

    //通过用户名查询
    @Select("select * from user where username = #{username}")
    User selectUserByName(String username);
    //用户数量
    @Select("select count(*) from user")
    int countUser();

}
